﻿using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.Contracts;

namespace TrackIT.Common.Repositories
{
    public interface IFileAccessRepository
    {
        void Save(List<string> items, string filename);

        IEnumerable<string> Load(string filename);
    }

    [ExcludeFromCodeCoverage]
    [ContractClassFor(typeof(IFileAccessRepository))]
    public class FileAccessRepositoryContract
    {
        public void Save(List<string> items, string filename)
        {
            Contract.Requires(items != null);
            Contract.Requires(!string.IsNullOrWhiteSpace(filename));
        }

        public IEnumerable<string> Load(string filename)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(filename));
            return default(IEnumerable<string>);
        }
    }
}